<template>
	<view>
		<view class="pt100" v-if="!list.length">
			<u-empty mode="list"></u-empty>
		</view>
		<view class="h10"></view>
		<view class="p20 flex bg-fff mb10 col-top" v-for="(item,index) in list" :key="index"
			@click="$params.type=='cash'?$jump('/pages/order/details',{order_id:item.join_id}):$goText({tit:item.name,api:this.goApi,announce_id:item.id})">
			<view class="w96 h96 pr">
				<u-badge is-center :count="item.num||0"></u-badge>
				<image :src="item.icon||'/static/img/msg/system.png'" class="wh-max" mode=""></image>
			</view>
			<view class="flex1  ml24 ov-h als-s ">
				<view class="flex row-between">
					<view class="flex1 line-1 fw-w">{{item.name}}</view>
					<view class="fs24 color-999">{{item.add_time}}</view>
				</view>
				<!-- <scroll-view scroll-y style="max-height: 600rpx;">
					<view class="pe-none">
						<u-parse :html="item.detail" :domain="$baseUrl"></u-parse>
					</view>
				</scroll-view> -->

				<view class="line-1 color-999 mt10" >{{item.create_time}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [],
				goApi: ''
			};
		},
		onLoad(e) {
			let goApi = '/master/message/announceInfo'
			if (e.type == 'cash') {
				goApi = '/platform/msg/interactInfo'
			}
			this.goApi = goApi
			this.getList()
		},
		onReachBottom() {
			this.getList('down')
		},
		methods: {
			getList(e) {
				e == 'down' ? this.page++ : this.page = 1
				let api = '/master/message/announceList'
				if (this.$params.type == 'cash') api = '/master/message/messageList'
				this.$request(api, {
					page: this.page
				}).then(res => {
					let list = res.data?.data || ''
					e == 'down' ? this.list.push(...list) : this.list = list
				})
			},
		}
	}
</script>

<style lang="scss">

</style>
